Field of the Invention
The invention relates to a data writing system, and more particularly to a data writing method for direct memory access (DMA).
Description of the Related Art
In a typical electronic system that comprises one or more processors, memories, and input/output (I/O) devices or interfaces, direct memory access (DMA) transfers are often used to transfer data between the I/O and the memory. When the processor uses programmed input/output without DMA, it is typically fully occupied for the entire duration of the read or write operation, and is thus unavailable to perform other tasks for the processor. When the processor initiates a DMA transfer, the processor can do other operations while the DMA transfer is in progress, and it receives an interrupt when the DMA transfer is done. Many hardware systems use DMA, including disk-drive controllers, graphics cards, network cards and sound cards. DMA is also used for intra-chip data transfer in multi-core processors. The electronic systems that have DMA channels can transfer data to and from devices with much less processor overhead than the electronic systems without DMA channels. Similarly, a processing element inside a multi-core processor can transfer data to and from its local memory without occupying its processor time, allowing computation and data transfer to proceed in parallel.